Skip to content

refactor: simplify token2idx creation with dict comprehension#168

Merged
ktro2828 merged 1 commit into
mainfrom
refactor/tier4/token2idx
Aug 18, 2025
Merged

refactor: simplify token2idx creation with dict comprehension#168
ktro2828 merged 1 commit into
mainfrom
refactor/tier4/token2idx

Conversation

@ktro2828

Copy link
Copy Markdown
Collaborator

What

This PR replaces nested loop with a more concise nested dictionary comprehension while maintaining the same functionality and improving readability.

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Copilot AI review requested due to automatic review settings August 18, 2025 07:14
@github-actions github-actions Bot added the refactor Refactoring code or increasing performance label Aug 18, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the token2idx creation logic by replacing a nested loop structure with a more concise nested dictionary comprehension. The change improves code readability while maintaining identical functionality for building a mapping from schema values to table tokens and their indices.

  • Replaced nested for loops with a single nested dictionary comprehension
  • Eliminated the need for a temporary variable and explicit dictionary initialization
  • Maintained the same data structure and functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions

github-actions Bot commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ❌

Overall Coverage

Lines Covered Coverage Threshold Status
2297 1562 68% 50% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
t4_devkit/tier4.py 17% 🔴
TOTAL 17% 🔴

updated for commit: 20c2d08 by action🐍

@ktro2828 ktro2828 merged commit 8baa726 into main Aug 18, 2025
5 checks passed
@ktro2828 ktro2828 deleted the refactor/tier4/token2idx branch August 18, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring code or increasing performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants